package com.wang.springframework.context.event;

import com.wang.springframework.context.ApplicationContext;
import com.wang.springframework.context.ApplicationEvent;

/**
 * @author wangjianhua
 * @Description
 * @date 2021/8/30/030 22:43
 */
public class ApplicationContextEvent extends ApplicationEvent {
    /**
     * Constructs a prototypical Event.
     *
     * @param source The object on which the Event initially occurred.
     * @throws IllegalArgumentException if source is null.
     */
    public ApplicationContextEvent(Object source) {
        super(source);
    }

    /**
     * 获取该事件提取出来的applicationContext
     * @return ApplicationContext 该接口面向用户
     */
    public final ApplicationContext getApplicationContext(){
        return (ApplicationContext) getSource();
    }
}
